<%@page import="org.jeecgframework.web.util.StaticValue"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
	<div region="center" style="padding:1px;">
		<t:datagrid name="zySendInspectionPlanList" checkbox="true" fitColumns="false" title="巡检计划" 
			actionUrl="zyInspectionPlanController.do?datagridOfIpListOfHomePageTask&homePageType=${homePageType }" idField="id" fit="true" queryMode="group" sortName="state" >
			<t:dgCol title="主键"			field="id"  	hidden="true"	queryMode="single"  width="120" />
			<t:dgCol title="巡检计划ID"		field="planId"    								queryMode="single"  query="true"	width="100" url="zyInspectionPlanController.do?detailsOfPlan&id={id}" funname="planDetials" />
			<t:dgCol title="巡检计划状态"		field="state"									dictionary="<%=StaticValue.DIC_PLAN_STATE %>" width="110" />
			<t:dgCol title="设备SN"			field="equipmentSpare.sn"    					queryMode="single"	query="true"	width="90" />
			<t:dgCol title="巡检计划备注"		field="remarks"    								width="220" sortable="false" />
			<t:dgCol title="影院名称"		field="equipmentSpare.zyCinema.name"			queryMode="single"  query="true"	width="180" sortable="false" />
			<t:dgCol title="省市"			field="tsTerritoryVal"							width="100"	sortable="false" />
			<t:dgCol title="省市"			field="equipmentSpare.tsTerritory.territoryName"	hidden="true"	queryMode="single"  query="true" sortable="false" />
			<t:dgCol title="影院地址"		field="equipmentSpare.zyCinema.address"			width="300"	sortable="false"/>
			<t:dgCol title="续保方"			field="equipmentSpare.companyOfRenewal"			width="120"	sortable="false" />
			<t:dgCol title="保修开始日期"		field="equipmentSpare.warrantyBeginDate"		width="100"	sortable="false" formatter="yyyy-MM-dd"/>
			<t:dgCol title="保修期"			field="equipmentSpare.repairDate"				width="120"	sortable="false"/>
			<t:dgCol title="派单指示"		field="equipmentSpare.sendSign.shortname"		width="180"	sortable="false" dictionary="t_s_depart,id,departname"/>
			<t:dgCol title="巡检单位"		field="company"									queryMode="single"  query="true"	dictionary="<%=StaticValue.DIC_INSPECTION_COMPANY %>"	width="80"/>
			<t:dgCol title="去年巡检日期"		field="equipmentSpare.lastYearInspectionDate"	width="100"		formatter="yyyy-MM-dd" />
			<t:dgCol title="计划巡检月份"		field="ipPlanDate"								width="150"		sortable="false" formatter="yyyy年-MM月"/>
			<t:dgCol title="预约上门时间"		field="engineerOrderTime"						width="90"		/>
			<t:dgCol title="创建时间"		field="createDate"						width="130"		formatter="yyyy-MM-dd hh:mm:ss" />
			<t:dgCol title="最后更新时间"		field="updateDate"						width="130"		formatter="yyyy-MM-dd hh:mm:ss" />
			
			<t:dgCol title="操作" field="opt" width="100"></t:dgCol>
			<t:dgFunOpt funname="sendPlanCol(id)" title="分派" exp="state#eq#${optRule }"></t:dgFunOpt>
			<t:dgToolBar title="批量分派" icon="icon-add" url="" funname="sendPlanToolBar"></t:dgToolBar>
			<t:dgToolBar title="导出" icon="icon-putout" url="" funname="exportIp"></t:dgToolBar>
		</t:datagrid>
	</div>
</div>
<script type="text/javascript">
$(function(){
	$("#zySendInspectionPlanListtb").find("input[name='actualDate_begin']").attr({"class":"Wdate","id":"actualDate_begin","style":"height:20px;width:90px;"}).click(function(){
		WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'actualDate_end\')}'});
		});
	$("#zySendInspectionPlanListtb").find("input[name='actualDate_end']").attr({"class":"Wdate","id":"actualDate_end","style":"height:20px;width:90px;"}).click(function(){
		WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'actualDate_begin\')}'});
		});
	territoryLink('zySendInspectionPlanList','equipmentSpare.tsTerritory.territoryName',1);
    setTimeout(function(){//延时调用查询，因为datagrid的field中的formatter 没有执行完毕
        zySendInspectionPlanListsearch();
    },500);
});
//遮罩，批量分派 回调。勿删
function closeProgress(data){
    lockmask(false);
    zySendInspectionPlanListsearch();
}
function testCheckIp(title,url){
    $.post(url,function(){
        tip("执行完毕");
    });
}
function testCheckReport(title,url){
    $.post(url,function(){
        tip("执行完毕");
    });
}
function testGetInfoFromLastYearIps(title,url){
    $.post(url,function(){
        tip("执行完毕");
    });
}
</script>
<script type="text/javascript" src="webpage/com/zybk/zy_inspection_plan/zyInspectionPlanList.js"></script>